<?php
	@ini_set('default_socket_timeout', 5);
	require_once("pre.php");
	require_once("../classes/Administrateur.class.php");
	
	session_start();
	
	header("Content-type: text/html; charset=utf-8");
	
	if(isset($action))
		if($action == "deconnexion") unset($_SESSION["util"]);
	
	require_once("../lib/simplepie.inc");
	require_once("../classes/Variable.class.php");
?>
<?php
	function couperTexte($texte, $nbcar){
        $res="";
        $cut = explode(" ", $texte);

        for($i=0; $i<count($cut); $i++)
                if(strlen($res) + strlen($cut[$i]) + 1 <= $nbcar) $res .= $cut[$i] . " ";
        else return $res;

        return $res;
	}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php require_once("title.php");?>
</head>

<body>
<div id="wrapper">
<div id="subwrapper">
<div id="entete">
	<div class="logo">
		<a href="accueil.php"><img src="gfx/thelia_logo.jpg" alt="THELIA solution e-commerce" /></a>
	</div>
<div id="menuGeneral">
	<div id="formConnex">
       		<form action="accueil.php" method="post" id="formulaire">
       			Nom d'utilisateur : 
             	<input name="identifiant" type="text" class="form" size="19" />
          		Mot de passe :
             	<input name="motdepasse" type="password" class="form" size="19" />
             	<input name="action" type="hidden" value="identifier" />
         		<input type="submit" value="valider"/>
         	</form>   
     </div>
     
</div>

<div id="contenu_int">
<?php

	@ini_set('default_socket_timeout', 5);


	$feed = new SimplePie();
	$feed->set_feed_url("http://blog.thelia.net/rss.php?cat=Formation");
	$feed->init();
	$feed->handle_content_type();

 	$chantitle = $feed->get_title();
	$chanlink = $feed->get_permalink(); 
		

	$tab=$feed->get_items();
	$item=$tab[0];

	 $link=$item->get_permalink();
	 $title=strip_tags($item->get_title());
	 $author=strip_tags($item->get_author());
	 $description=strip_tags($item->get_description());
	 $dateh=$item->get_date('j F Y | g:i a');
	 $jour=$item->get_date('j');
	 $mois=$item->get_date('m');
	 $annee=$item->get_date('Y');
	 $heure=$item->get_date('g');
	 $minute=$item->get_date('i');
	 $seconde=$item->get_date('a');
?>
	<div class="Bloc_news_index">
		<div class="picto"><img src="gfx/picto-formation.gif" /></div>
		<div class="texte"><li class="date"><?php echo($jour . "/" . $mois . "/" . $annee); ?></li><li class="titre"><a href="<?php echo($link); ?>" target="_blank"><?php echo $title; ?></a></li><br /><?php echo couperTexte($description, 150) . "..."; ?></div>
	</div>
<?php


	$feed = new SimplePie();
	$feed->set_feed_url("http://blog.thelia.net/rss.php?cat=General");
	$feed->init();
	$feed->handle_content_type();

 	$chantitle = $feed->get_title();
	$chanlink = $feed->get_permalink(); 
		

	$tab=$feed->get_items();
	$item=$tab[0];



	 $link=$item->get_permalink();
	 $title=strip_tags($item->get_title());
	 $author=strip_tags($item->get_author());
	 $description=strip_tags($item->get_description());
	 $dateh=$item->get_date('j F Y | g:i a');
	 $jour=$item->get_date('j');
	 $mois=$item->get_date('m');
	 $annee=$item->get_date('Y');
	 $heure=$item->get_date('g');
	 $minute=$item->get_date('i');
	 $seconde=$item->get_date('a');
?>
	<div class="Bloc_news_index">
		<div class="picto"><img src="gfx/picto-news.gif" /></div>
		<div class="texte"><li class="date"><?php echo($jour . "/" . $mois . "/" . $annee); ?></li><li class="titre"><a href="<?php echo($link); ?>" target="_blank"><?php echo $title; ?></a></li><br /><?php echo couperTexte($description, 150) . "..."; ?></div>
	</div>
<?php

		
		
		
	$feed = new SimplePie();
	$feed->set_feed_url("http://blog.thelia.net/rss.php?cat=Securite");
	$feed->init();
	$feed->handle_content_type();

 	$chantitle = $feed->get_title();
	$chanlink = $feed->get_permalink(); 
		

	$tab=$feed->get_items();
	$item=$tab[0];



	 $link=$item->get_permalink();
	 $title=strip_tags($item->get_title());
	 $author=strip_tags($item->get_author());
	 $description=strip_tags($item->get_description());
	 $dateh=$item->get_date('j F Y | g:i a');
	 $jour=$item->get_date('j');
	 $mois=$item->get_date('m');
	 $annee=$item->get_date('Y');
	 $heure=$item->get_date('g');
	 $minute=$item->get_date('i');
	 $seconde=$item->get_date('a');
?>
	<div class="Bloc_news_index">
		<div class="picto"><img src="gfx/picto-alertes.gif" /></div>
		<div class="texte"><li class="date"><?php echo($jour . "/" . $mois . "/" . $annee); ?></li><li class="titre"><a href="<?php echo($link); ?>" target="_blank"><?php echo $title; ?></a></li><br /><?php echo couperTexte($description, 150) . "..."; ?></div>
	</div>
</div>

</div> 

    <?php require_once("pied.php");?>
</div>
</div>
</body>
</html>
